package com.game.proxy
{
	import com.dusk.util.ArrayUtil;
	import config.Config;
	
	public class GameProcessProxy
	{
		public function GameProcessProxy()
		{
			super();
		}
		
		private function getProcessList():Array
		{
			return Config.getIns().userData.gameProcess;
		}
		
		public function achieveProcess(... rest):void
		{
			for each(var name:String in rest)
			{
				if(!hasAchieveProcess(name))
				{
					getProcessList().push(name);
				}
			}
		}
		
		public function clearProcess(... rest):void
		{
			for each(var name:String in rest)
			{
				ArrayUtil.removeElement(getProcessList(), name);
			}
		}
		
		public function hasAchieveProcess(name:String):Boolean
		{
			return ArrayUtil.contains(getProcessList(), name);
		}
		
		public function clearAllProcess():void
		{
			ArrayUtil.removeAllElement(getProcessList());
		}
	}
}